import request from './request.js'

export async function getMovies (page = 1, limit = 10) {
  let resp = await request.get('/api/movie', {
    params: {
      page: page,
      limit: limit
    }
  })
  return resp.data
}


export async function getMovie (id) {
  let resp = await request.get(`/api/movie/${id}`)
  return resp.data

  // 测试静态化
  // return new Promise(resolve => {
  //   setTimeout(async () => {
  //     let resp = await request.get(`/api/movie/${id}`)
  //     resolve(resp.data)
  //   }, 1000)
  // })
}
